package com.battle.service.controller.web;

import com.battle.pojo.param.trainingPersonSetting.*;
import com.battle.pojo.vo.trainingPersonSetting.*;
import com.battle.service.service.in.*;
import nirvana.core.domains.vo.PageResult;
import nirvana.core.domains.vo.ApiResult;
import org.springframework.web.bind.annotation.*;

import jakarta.validation.Valid;

import java.util.List;

/**
 * web/训练人员设置
 * 【描 述】：
 * 【环 境】：J2SE
 * 【详 细】：
 */
@RestController
@RequestMapping("/trainingPersonSetting/web")
public class TrainingPersonSettingWebController {

    private final TrainingPersonSettingService service;

    public TrainingPersonSettingWebController(TrainingPersonSettingService service) {
        this.service = service;
    }


    /**
     * 创建训练人员设置
     *
     * @param param
     * @return
     */
    @PostMapping("/createTrainingPersonSetting")
    public ApiResult createTrainingPersonSetting(@RequestBody @Valid CreateTrainingPersonSettingParam param) {
        service.createTrainingPersonSetting(param);
        return ApiResult.ok();
    }

    /**
     * 批量移除训练人员设置
     * @param param
     * @return
     */
    @PostMapping("/bathRemoveTrainingPersonSetting")
    public ApiResult bathRemoveTrainingPersonSetting(@RequestBody @Valid CreateTrainingPersonSettingParam param) {
        service.bathRemoveTrainingPersonSetting(param);
        return ApiResult.ok();
    }


    /**
     * 获取训练人员设置列表
     *
     * @param param
     * @return
     */
    @PostMapping("/getTrainingPersonSettingList")
    public ApiResult<PageResult<GetTrainingPersonSettingListVo>> getTrainingPersonSettingList(@RequestBody GetTrainingPersonSettingListParam param) {
        PageResult<GetTrainingPersonSettingListVo> result = service.getTrainingPersonSettingList(param);
        return ApiResult.ok(result);
    }

}

